package com.im.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import com.core.sdk.ui.TabAcitivty;
import com.im.R;
import com.im.event.UserRequestEvent;
import com.im.event.UserRequestEvent.OPERATE;
import com.im.service.SmackService;

public class HomeActivity extends TabAcitivty {
	
	public static Intent createIntent(Context ctx){
		Intent it = new Intent(ctx,HomeActivity.class);
		return it;
	}
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		addTab("会话", -1, R.drawable.sl_bg_tab , TabSessionListFragment.class);
		addTab("联系人", -1, R.drawable.sl_bg_tab, TabContactListFragment.class);
		addTab("设置", -1, R.drawable.sl_bg_tab, TabSettingsFragment.class);
		mTabHost.setCurrentTab(1);
		
	}
	
	@Override
	protected void onDestroy() {
		UserRequestEvent event = new UserRequestEvent(findLocation(SmackService.class),OPERATE.request_logout);
		sendEvent(event);
		super.onDestroy();
	}

}
